package com.test;

import java.io.File;
import java.io.IOException;

import org.beetl.core.Configuration;
import org.beetl.core.GroupTemplate;
import org.beetl.core.Template;
import org.beetl.core.resource.FileResourceLoader;

public class Core {

	public GroupTemplate   initCharTenmplate() throws IOException{
		String root = System.getProperty("user.dir")+File.separator+"template";
		FileResourceLoader resourceLoader = new FileResourceLoader(root,"utf-8");
		Configuration cfg;
		cfg = Configuration.defaultConfiguration();
		GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
		return gt;
	}
	
	public static void main(String[] args) {
		try {
			GroupTemplate gt = new Core().initCharTenmplate();
			Template t = gt.getTemplate("/pie.txt");
			System.out.println(t.render());
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}
